package org.pork.service;

import java.util.List;

import javax.inject.Inject;

import org.apache.log4j.Logger;
import org.pork.criteria.AccountCriteria;
import org.pork.domain.AccountReplyVO;
import org.pork.domain.AccountVO;
import org.pork.mapper.AccountMapper;
import org.pork.mapper.AccountReplyMapper;
import org.springframework.stereotype.Service;

@Service
public class AccountService {


	Logger logger = Logger.getLogger("AccountService");
	
	@Inject
	AccountMapper aMapper;
	
	@Inject
	AccountReplyMapper aRepMapper;
	
	public void regist(AccountVO vo) throws Exception {
		
		logger.info("EmployeesService regist.........");
		
		aMapper.create(vo);
	
	}

	
	public AccountVO view(String accountCode) throws Exception {
		
		logger.info("EmployeesService view..........");
			
		return aMapper.read(accountCode);
		
	}

	
	public void remove(String accountCode) throws Exception {
		
		logger.info("EmployeesService remove...........");
		
		aMapper.delete(accountCode);
		
	}

	
	public void modify(AccountVO vo) throws Exception {
		
		logger.info("EmployeesService update...........");
		
		aMapper.update(vo);
		
	}
	
	
	public List<AccountVO> list(AccountCriteria aCri) throws Exception {
		
		logger.info("EmployeesService list..............");
		
		return aMapper.list(aCri);
		
	}
	
	
	public void replyRegist(AccountReplyVO aReVO) throws Exception {
		
		logger.info("EmployeesService replyRegist...........");
		
		aRepMapper.create(aReVO);
		
	}
	
	
	public List<AccountReplyVO> replyList(String accountCode) throws Exception{
		
		logger.info("EmployeesService replyList...........");
		
		return aRepMapper.list(accountCode);
		
	}
	
	
	public void replyDelete(Integer seqno) throws Exception{
		
		logger.info("EmployeesService replyDelete...........");
		
		aRepMapper.delete(seqno);
		
	}
	
	
	public void replyUpdate(AccountReplyVO aReVO) throws Exception{
		
		logger.info("EmployeesService replyUpdate............");
		
		aRepMapper.update(aReVO);
	} 
	
}



























